<template>
  <div>
    <b-menu-list v-if="!isSubmenuList"  >
      <item v-for="(menuMap,index) in data" @tree-change="changeItem" :item="menuMap" />
    </b-menu-list>
    <item v-else v-for="(menuMap,index) in data" :key="index" @tree-change="changeItem" :item="menuMap" />
  </div>
</template>

<script>
import item from "./item";
export default {
  name: "sidebarList",
  components: {item},
  props:{
    isSubmenuList: {
      type: Boolean,
      default: false
    },
    data: {
      type: Array,
      default: () => []
    }
  },
  methods:{
    changeItem(item){
      this.$emit('tree-change', item)
    },
  }
}
</script>

<style scoped>

</style>
